<?php

class EventController extends Zend_Controller_Action {
	
	protected $_event;
	public function init(){
		$this->_event = new Model_Event($this->_getParam('id', null));
	}
	
	public function indexAction() {
		$id = (int) $this->_getParam('id', null);
		$category = new Model_Category_Event($id);
		$this->view->currentCategory = $category->getRow();
	}
	
	public function addAction()
	{
		$this->view->form = new Form_Event();
	}
	
	public function addplaceAction()
	{
		Zend_Layout::getMvcInstance()->disableLayout();
		$connector = new Model_Connect_Place_Event();
		$place_id = (int) $this->_getParam('place_id', null);
		$model =  new Model_DbTable_Event();
		$connector->add($place_id, $this->_event->getRow()->id);
	}
}

